home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2001 January / Game.EXE_01_2001.iso / demos / Blade of Darkness / data1.cab / Program_Executable_Files / Lib / Sparks.py < prev    next >
Encoding:
Text File  |  2000-11-16  |  17.4 KB  |  466 lines

  1. import Bladex
  2. import B3DLib
  3. import Reference
  4. import netgame
  5. import Damage
  6. import Water
  7. import whrandom
  8. import Breakings
  9. import Blood
  10.  
  11. def ThrowSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  12.     obj= Bladex.GetEntity(hitting_entity)
  13.     try:
  14.         if obj and obj.Data.NoFXOnHit:
  15.             return
  16.     except: pass
  17.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  18.     if mod<5000.0:
  19.         return
  20.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  21.     chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  22.  
  23. def ThrowMetalSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  24.     obj= Bladex.GetEntity(hitting_entity)
  25.     try:
  26.         if obj and obj.Data.NoFXOnHit:
  27.             return
  28.     except: pass
  29.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  30.     if mod<5000.0:
  31.         return
  32.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  33.     chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  34.  
  35.     # sound
  36.     on_hit_info= Reference.MaterialOnHitInfo['Metal']
  37.     sound= on_hit_info[0]
  38.  
  39.     if sound:
  40.         sound.Stop()
  41.         sound.Play(xhit_point, yhit_point, zhit_point, 0)
  42.  
  43. def ThrowDustAndSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  44.     obj= Bladex.GetEntity(hitting_entity)
  45.     try:
  46.         if obj and obj.Data.NoFXOnHit:
  47.             return
  48.     except: pass
  49.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  50.     if mod<5000.0:
  51.         return
  52.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  53.     chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  54.     
  55.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  56.     polvillo.ParticleType="MediumDust"
  57.     polvillo.YGravity=200
  58.     polvillo.Friction=0.2
  59.     polvillo.PPS=200
  60.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  61.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  62.     polvillo.RandomVelocity=40.0
  63.     polvillo.RandomVelocity_V=1.0
  64.  
  65. def ThrowWoodenSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  66.     obj= Bladex.GetEntity(hitting_entity)
  67.     try:
  68.         if obj and obj.Data.NoFXOnHit:
  69.             return
  70.     except: pass
  71.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  72.     if mod<5000.0:
  73.         return
  74.     
  75.     # spark
  76.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  77.     spark= Bladex.CreateSpark("Wood",xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],      0.75,2000,60,0,80,   75,46,21,   6,3,2,    900,15.0/60.0,1.0/60.0,0)
  78.     spark.RasterMode="BlendingAlpha"
  79.     
  80.     # dust
  81.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  82.     polvillo.ParticleType="MediumDust"
  83.     polvillo.YGravity=200
  84.     polvillo.Friction=0.2
  85.     polvillo.PPS=250
  86.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  87.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  88.     polvillo.RandomVelocity=40.0
  89.     polvillo.RandomVelocity_V=1.0
  90.     
  91.     # sound
  92.     on_hit_info= Reference.MaterialOnHitInfo['MaderaTablas']
  93.     sound= on_hit_info[0]
  94.  
  95.     if sound:
  96.         sound.Stop()
  97.         sound.Play(xhit_point, yhit_point, zhit_point, 0)
  98.  
  99. def ThrowStoneSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  100.     obj= Bladex.GetEntity(hitting_entity)
  101.     try:
  102.         if obj and obj.Data.NoFXOnHit:
  103.             return
  104.     except: pass
  105.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  106.     if mod<5000.0:
  107.         return
  108.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  109.     chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  110.     
  111.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  112.     polvillo.ParticleType="MediumDust"
  113.     polvillo.YGravity=200
  114.     polvillo.Friction=0.2
  115.     polvillo.PPS=200
  116.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  117.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  118.     polvillo.RandomVelocity=40.0
  119.     polvillo.RandomVelocity_V=1.0
  120.  
  121.     on_hit_info= Reference.MaterialOnHitInfo['Piedra']
  122.     sound= on_hit_info[0]
  123.  
  124.     if sound:
  125.         sound.Stop()
  126.         sound.Play(xhit_point, yhit_point, zhit_point, 0)
  127.  
  128.  
  129. def SetSparkling(obj_name):
  130.     obj=Bladex.GetEntity(obj_name)
  131.     if obj.HitFunc:
  132.         print "Este objeto ya es rompible o chispeante."
  133.         return
  134.     obj.Static=0
  135.     obj.HitFunc=ThrowSparks
  136.     return obj
  137.     
  138. def SetDustySparkling(obj_name):
  139.     obj=Bladex.GetEntity(obj_name)
  140.     if obj.HitFunc:
  141.         print "Este objeto ya es rompible o chispeante."
  142.         return
  143.     obj.Static=0
  144.     obj.HitFunc=ThrowDustAndSparks
  145.     return obj
  146.  
  147. def SetWoodenSparkling(obj_name):
  148.     obj=Bladex.GetEntity(obj_name)
  149.     if obj.HitFunc:
  150.         print "Este objeto ya es chispeante."
  151.         return
  152.     obj.Static=0
  153.     obj.HitFunc=ThrowWoodenSparks        
  154.     return obj
  155.  
  156. def SetMetalSparkling(obj_name):
  157.     obj=Bladex.GetEntity(obj_name)
  158.     if obj.HitFunc:
  159.         print "Este objeto ya es rompible o chispeante."
  160.         return
  161.     obj.Static=0
  162.     obj.HitFunc=ThrowMetalSparks
  163.     return obj
  164.  
  165. def SetStoneSparkling(obj_name):
  166.     obj=Bladex.GetEntity(obj_name)
  167.     if obj.HitFunc:
  168.         print "Este objeto ya es rompible o chispeante."
  169.         return
  170.     obj.Static=0
  171.     obj.HitFunc=ThrowStoneSparks
  172.     return obj
  173.  
  174. import pdb
  175.  
  176. def ThrowSparksShield(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,DamageType):
  177.     hitting_ent=Bladex.GetEntity(hitting_entity)
  178.         
  179.     hitting_ent.MessageEvent(Reference.MESSAGE_STOP_WEAPON,0,0)
  180.     
  181.     skip_sparks=0
  182.     try:
  183.         if hitting_ent.Data.NoFXOnHit:
  184.             skip_sparks=1
  185.     except: pass
  186.     if not skip_sparks:
  187.         sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  188.         chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  189.     hit_ent=Bladex.GetEntity(hit_entity)
  190.     
  191.     datos_esc=Reference.DefaultObjectData[hit_ent.Kind]
  192.     if datos_esc[0]==Reference.OBJ_SHIELD:
  193.         Reference.DefaultObjectData[hit_ent.Kind][3].Play(xhit_point, yhit_point, zhit_point, 0)
  194.     else:
  195.         if datos_esc[0]==Reference.OBJ_WEAPON:
  196.             if Reference.GiveWeaponFlag(hit_entity)<>Reference.W_FLAG_1H:
  197.                 Reference.DefaultObjectData[hit_ent.Kind][5][6].Play(xhit_point, yhit_point, zhit_point, 0)    
  198.  
  199.     VictimName=hit_ent.Parent
  200.     AttackerName=hitting_ent.Parent
  201.     pj=Bladex.GetEntity(VictimName)
  202.     
  203.     if hitting_ent.Arrow and (hitting_ent.Parent):
  204.         pdb.set_trace()
  205.     
  206.     pj.DamageFunc(VictimName, AttackerName, hitting_entity, DamageType, 0, -1, xhit_point, yhit_point, zhit_point, 1)
  207.     
  208.     if netgame.GetNetState() == 1:
  209.         netgame.CallEventSound(hit_entity,4)
  210.     
  211.     if hitting_ent.Arrow and (not hitting_ent.Parent):        
  212.         hitting_ent.Stop()
  213.         # Check type of damage
  214.         impact= hitting_ent.GraspPos ("Impact")
  215.         centre= hitting_ent.Position
  216.         impact2centre= centre[0]-impact[0], centre[1]-impact[1], centre[2]-impact[2]
  217.         abs_pos= xhit_point+impact2centre[0], yhit_point+impact2centre[1], zhit_point+impact2centre[2]
  218.         rel_pos= hit_ent.Abs2RelPoint(abs_pos[0], abs_pos[1], abs_pos[2])
  219.         # To bring it closer to centre, multiply vector by < 1.0
  220.         hitting_ent.Position= rel_pos[0]*0.8, rel_pos[1], rel_pos[2]*0.8
  221.         hit_ent.Link(hitting_ent)
  222.         sticktime= (1.0)/hitting_ent.Mass
  223.         Bladex.AddScheduledFunc (Bladex.GetTime()+sticktime, Damage.StuckWeaponFall, (hitting_ent.Name, hit_ent.Name), hitting_ent.Name+"_StuckWeaponFall")
  224.         if hitting_ent.StickFunc:
  225.             hitting_ent.StickFunc (hitting_entity, hit_entity)
  226.  
  227.  
  228. def SetShieldArea(obj_name, cone, height, radius):
  229.     esc=Bladex.GetEntity(obj_name)
  230.     if not esc.Weapon:
  231.         esc.Static=1
  232.     esc.Weapon=1
  233.     esc.Cone=cone
  234.     esc.Height=height
  235.     esc.Radius=radius
  236.     esc.HitShieldFunc=ThrowSparksShield
  237.     return esc
  238.  
  239. def MakeShield(obj_name):
  240.     esc=Bladex.GetEntity(obj_name)
  241.     if not esc.Weapon:
  242.         esc.Static=1
  243.     esc.Weapon=1
  244.     datos_esc=Reference.DefaultObjectData[esc.Kind]
  245.  
  246.     if datos_esc[0]==Reference.OBJ_SHIELD:
  247.         esc.Cone=datos_esc[4]
  248.         esc.Height=datos_esc[5]
  249.         esc.Radius=datos_esc[6]
  250.         if datos_esc[7]:
  251.             Breakings.SetBreakableWS(obj_name)
  252.     else:
  253.         esc.Cone=3.1416
  254.         esc.Height=2000
  255.         esc.Radius=750
  256.         if datos_esc[0]==Reference.OBJ_STANDARD or datos_esc[0]==Reference.OBJ_WEAPON:
  257.             if Reference.GiveWeaponFlag(obj_name)<>Reference.W_FLAG_1H:
  258.                 esc.Cone=datos_esc[5][1]
  259.                 esc.Height=datos_esc[5][2]
  260.                 esc.Radius=datos_esc[5][3]
  261.                 if datos_esc[5][5]:
  262.                     Breakings.SetBreakableWS(obj_name)
  263.             else:
  264.                 print "MakeShield. Unexpected weapon FLAG"
  265.         else:
  266.             print "MakeShield. Unexpected type of object"
  267.         
  268.  
  269.     esc.HitShieldFunc=ThrowSparksShield
  270.     return esc
  271.  
  272. stones_active=0
  273. max_stones_active=4
  274.  
  275. def RemoveStone(obj_name):
  276.     global stones_active
  277.     Piedra= Bladex.GetEntity(obj_name)
  278.     if Piedra:
  279.         Piedra.SubscribeToList("Pin")
  280.         stones_active= stones_active-1
  281.  
  282. def DropStone(x,y,z,dx=1,dy=1,dz=1, Pname= "Piedra_01"):
  283.     global stones_active
  284.     
  285.     if stones_active<max_stones_active:    
  286.         Piedra=Bladex.CreateEntity("Piedrita", Pname, x,y,z, "Physic")
  287.         #Piedra.Mass= 1
  288.         Piedra.Scale= 0.075 + whrandom.random()*0.13        
  289.         
  290.         mod=B3DLib.Modulo(dx,dy,dz)    
  291.         dx=dx/mod + whrandom.random()*0.4 - whrandom.random()*0.4
  292.         dy=dy/mod + whrandom.random()*0.4 - whrandom.random()*0.4
  293.         dz=dz/mod + whrandom.random()*0.4 - whrandom.random()*0.4    
  294.         dx,dy,dz= B3DLib.Scale((dx,dy,dz),mod)
  295.         
  296.         Piedra.ExclusionGroup=1
  297.         Piedra.ImpulseC(x+(whrandom.random()*200.0-100.0), y+(whrandom.random()*-100.0), z+(whrandom.random()*200.0-100.0),dx,dy,dz)
  298.         
  299.         Piedra.OnStopFunc= RemoveStone
  300.         stones_active=stones_active+1
  301.         return Piedra
  302.     else:
  303.         return None
  304.         
  305. def SectorThrowSparks(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):    
  306.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  307.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  308.     sparkdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)    
  309.     spark=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],   0.5,3000,2000,0,100,   160,120,40,   30,24,0,     800,10.0/60.0,1.0/60.0,1)        
  310.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  311.     polvillo.ParticleType="MediumDust"
  312.     polvillo.YGravity=200
  313.     polvillo.Friction=0.2
  314.     polvillo.PPS=200
  315.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  316.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  317.     polvillo.RandomVelocity=40.0
  318.     polvillo.RandomVelocity_V=1.0    
  319.     nstones= whrandom.randint(0,max_stones_active)
  320.     stone_startx= xhit_point+x_norm*200.0
  321.     stone_starty= yhit_point+y_norm*200.0
  322.     stone_startz= zhit_point+z_norm*200.0
  323.     stone_impx= x_norm*2000
  324.     stone_impy= y_norm*2000
  325.     stone_impz= z_norm*2000    
  326.     for i in range(nstones):
  327.         DropStone(stone_startx, stone_starty, stone_startz, stone_impx, stone_impy, stone_impz)    
  328.  
  329. def SectorThrowSnow(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  330.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  331.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  332.     sparkdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)    
  333.     spark= Bladex.CreateSpark("Snow",xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],      0.8,400,100,10,20, 200,200,200, 56,56,56,        600,90.0/60.0,1.0/60.0,0)
  334.     spark.RasterMode="BlendingAlpha"    
  335.  
  336.     tierra1=Bladex.CreateEntity("SnowDust", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  337.     tierra1.ParticleType="SnowDust"
  338.     tierra1.YGravity=200.0
  339.     tierra1.Friction=0.15
  340.     tierra1.PPS=200
  341.     tierra1.Time2Live=64
  342.     tierra1.Velocity=sparkdir[0]*2000.0, sparkdir[1]*2000.0, sparkdir[2]*2000.0    
  343.     tierra1.RandomVelocity=10.0
  344.     tierra1.DeathTime=Bladex.GetTime()+0.05
  345.  
  346.  
  347. def SectorThrowWood(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  348.     #astilla
  349.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  350.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  351.     sparkdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)    
  352.     spark= Bladex.CreateSpark("Wood",xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],      0.75,2000,60,0,80,   75,46,21,   6,3,2,    900,15.0/60.0,1.0/60.0,0)
  353.     spark.RasterMode="BlendingAlpha"
  354.     
  355.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  356.     polvillo.ParticleType="MediumDust"
  357.     polvillo.YGravity=200
  358.     polvillo.Friction=0.2
  359.     polvillo.PPS=250
  360.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  361.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  362.     polvillo.RandomVelocity=40.0
  363.     polvillo.RandomVelocity_V=1.0
  364.  
  365. def SectorThrowWater(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  366.     #astilla
  367.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  368.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  369.     reflectdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)
  370.     
  371.     Aguita1=Bladex.CreateEntity("Cristales", "Entity Particle System D1",xhit_point, yhit_point, zhit_point)
  372.     Aguita1.ParticleType="Splash"
  373.     Aguita1.PPS=1024
  374.     Aguita1.YGravity=2500.0
  375.     Aguita1.Friction=0
  376.     Aguita1.Velocity=reflectdir[0]*2500.0, reflectdir[1]*2500.0, reflectdir[2]*2500.0
  377.     Aguita1.RandomVelocity=15.0
  378.     Aguita1.Time2Live=32
  379.     Aguita1.DeathTime=Bladex.GetTime()+0.10
  380.     Aguita1.Reflects=0
  381.     
  382.     Aguita2=Bladex.CreateEntity("Cristales","Entity Particle System Dobj", 0, 0, 0)
  383.     Aguita2.ObjectName=entity_name
  384.     Aguita2.ParticleType= "Splash"
  385.     Aguita2.PPS= 1024
  386.     Aguita2.YGravity= 4500.0
  387.     Aguita2.Friction= 0.1
  388.     Aguita2.RandomVelocity= 13.0
  389.     Aguita2.Time2Live= 64
  390.     Aguita2.DeathTime= Bladex.GetTime()+0.2
  391.     Aguita2.Reflects=0
  392.  
  393. def GenericSectorOnHit(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  394.     try:
  395.         obj= Bladex.GetEntity(entity_name)
  396.         if obj.Data.NoFXOnHit:
  397.             return
  398.     except: pass    
  399.     if Reference.MaterialOnHitInfo.has_key(material):    
  400.         on_hit_info= Reference.MaterialOnHitInfo[material]
  401.     else:
  402.         on_hit_info= Reference.MaterialOnHitInfo['default']
  403.     sound= on_hit_info[0]
  404.     func=  on_hit_info[1]
  405.  
  406.     if sound:
  407.         sound.Stop()
  408.         sound.Play(xhit_point, yhit_point, zhit_point, 0)
  409.     if func:
  410.         func (sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material)
  411.     
  412. def SetSectorOnHitFuncs():
  413.     GolpeGrava= Bladex.CreateSound('..\\..\\sounds\\golpe_grava.wav', 'GolpeGrava')
  414.     GolpeGrava.SetPitchVar(1, -8000, 8000, 0, 0)
  415.     
  416.     GolpeNieve= Bladex.CreateSound('..\\..\\sounds\\golpe-nieve.wav', 'GolpeNieve')
  417.     GolpeNieve.SetPitchVar(1, -8000, 8000, 0, 0)
  418.  
  419.     GolpeTierra= Bladex.CreateSound('..\\..\\sounds\\golpe_hierba.wav', 'GolpeTierra')
  420.     GolpeTierra.SetPitchVar(1, -8000, 8000, 0, 0)
  421.  
  422.     GolpeAgua= Bladex.CreateSound('..\\..\\sounds\\golpe_agua.wav', 'GolpeAgua')
  423.     GolpeAgua.SetPitchVar(1, -8000, 8000, 0, 0)
  424.  
  425.     GolpeHierba= Bladex.CreateSound('..\\..\\sounds\\golpe_hierba2.wav', 'GolpeHierba')
  426.     GolpeHierba.SetPitchVar(1, -8000, 8000, 0, 0)
  427.  
  428.     GolpeMaderaTablas= Bladex.CreateSound('..\\..\\sounds\\golpe_maderamed.wav', 'GolpeMaderaTablas')
  429.     GolpeMaderaTablas.SetPitchVar(1, -8000, 8000, 0, 0)
  430.  
  431.     GolpeMaderaTablas= Bladex.CreateSound('..\\..\\sounds\\golpe_maderamed.wav', 'GolpeMaderaTablas')
  432.     GolpeMaderaTablas.SetPitchVar(1, -8000, 8000, 0, 0)
  433.     
  434.     GolpeMadera= Bladex.CreateSound('..\\..\\sounds\\M-GOLPESHEAVY4.wav', 'GolpeMadera')
  435.     GolpeMadera.SetPitchVar(1, -8000, 8000, 0, 0)
  436.     
  437.     GolpeMetal= Bladex.CreateSound('..\\..\\sounds\\GOLPE-ARMADUR-1.wav', 'GolpeMetal')
  438.     GolpeMetal.SetPitchVar(1, -8000, 8000, 0, 0)
  439.     
  440.     GolpeCristal= Bladex.CreateSound('..\\..\\sounds\\golpe-cristal-4.wav', 'GolpeCristal')
  441.     GolpeCristal.SetPitchVar(1, -8000, 8000, 0, 0)
  442.  
  443.  
  444.     Reference.MaterialOnHitInfo['default']= [GolpeGrava, SectorThrowSparks]        
  445.  
  446.     Reference.MaterialOnHitInfo['Grava']=       [GolpeGrava, SectorThrowSparks]
  447.     Reference.MaterialOnHitInfo['Piedra']=      [GolpeGrava, SectorThrowSparks]
  448.     Reference.MaterialOnHitInfo['Nieve']=       [GolpeNieve, SectorThrowSnow]
  449.     Reference.MaterialOnHitInfo['Hierba']=      [GolpeHierba, None]
  450.     Reference.MaterialOnHitInfo['Tierra']=      [GolpeTierra, None]
  451.     
  452.     Reference.MaterialOnHitInfo['Madera']=      [GolpeMadera, SectorThrowWood]
  453.     Reference.MaterialOnHitInfo['MaderaTablas']=[GolpeMaderaTablas, SectorThrowWood]
  454.     Reference.MaterialOnHitInfo['Barro']=       [None, None]
  455.     Reference.MaterialOnHitInfo['Water']=       [GolpeAgua, SectorThrowWater]
  456.     Reference.MaterialOnHitInfo['Metal']=       [GolpeMetal, SectorThrowSparks]
  457.     Reference.MaterialOnHitInfo['Cristal']=     [GolpeCristal, None]
  458.  
  459.     if netgame.GetNetState() == 0:    
  460.         for i in range (Bladex.nSectors()):
  461.             sector= Bladex.GetSector(i)
  462.             if not sector.OnHit:
  463.                 sector.OnHit= GenericSectorOnHit
  464.  
  465.  
  466. SetSectorOnHitFuncs()